package com.xiangxiangjd.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Objects;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 申领和物品中间表
 *
 * @author 肖守凯
 * @since 2021-11-08
 */
@TableName("handover_goods")
@ApiModel(value = "HandoverGoods对象", description = " 交接和物品中间表")
@Data
public class HandoverGoods extends Model<HandoverGoods> {

  private static final long serialVersionUID = 1L;

  @ApiModelProperty(value = "id")
  @TableId(value = "id", type = IdType.ID_WORKER_STR)
  private String id;

  @ApiModelProperty(value = "交接单号id")
  @TableField("handover_id")
  private Integer handoverId;

  @ApiModelProperty(value = "物品id")
  @TableField("goods_id")
  private String goodsId;

  /** 下列为 航材交接确认 参数 */
  @ApiModelProperty(value = "航材名称")
  @TableField(exist = false)
  private String goodsName;

  @ApiModelProperty(value = "规格")
  @TableField(exist = false)
  private String model;

  @ApiModelProperty(value = "单价")
  @TableField(exist = false)
  private String price;

  @ApiModelProperty(value = "交接批次号")
  @TableField(exist = false)
  private String handoverOddNumber;

  @ApiModelProperty(value = "航材数量")
  @TableField(exist = false)
  private String number;


  @ApiModelProperty(value = "接收人ID")
  @TableField(exist = false)
  private String handoverUsersId;

  @ApiModelProperty(value = "物品图片")
  @TableField(exist = false)
  private String entityImgUrl;

  @ApiModelProperty(value = "状态 0 交接待确/1 拒绝交接/ 2 交接待审批 / 3交接审批通过 /4 交接审批不通过/")
  @TableField(exist = false)
  private String handoverDateNoState;

  @ApiModelProperty(value = "交接人ID")
  @TableField(exist = false)
  private String userId;


  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    HandoverGoods that = (HandoverGoods) o;
    return Objects.equals(handoverId, that.handoverId) &&
            Objects.equals(goodsId, that.goodsId) &&
            Objects.equals(goodsName, that.goodsName) &&
            Objects.equals(model, that.model) &&
            Objects.equals(price, that.price) &&
            Objects.equals(handoverOddNumber, that.handoverOddNumber) &&
            Objects.equals(number, that.number) &&
            Objects.equals(handoverUsersId, that.handoverUsersId) &&
            Objects.equals(entityImgUrl, that.entityImgUrl) &&
            Objects.equals(handoverDateNoState, that.handoverDateNoState) &&
            Objects.equals(userId, that.userId);
  }

  @Override
  public int hashCode() {
    return Objects.hash(handoverId, goodsId, goodsName, model, price, handoverOddNumber, number, handoverUsersId, entityImgUrl, handoverDateNoState, userId);
  }
}
